/* --- ส่วนพื้นฐาน (Global Styles) --- */
:root {
    --primary-color: #00054d; /* สีเข้มหลัก (คล้ายโลโก้/สีทางการ) */
    --secondary-color: #808bcb; /* สีรอง */
    --text-color: #333;
    --light-bg: #f5f5f5;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Kanit', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: #fff;
}

.container {
    max-width: 1200px;
    margin: auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

ul {
    list-style: none;
}

h2, h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
    text-align: center;
}

section {
    padding: 60px 0;
}

.center {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* ปุ่ม (Buttons) */
.btn-primary {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #00796b;
}

.btn-contact {
    background: var(--secondary-color);
    color: var(--primary-color) !important;
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: 600;
}


/* --- ส่วนหัว (Header) --- */
.main-header {
    background: #fff;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    color: var(--primary-color);
    font-size: 24px;
    font-weight: 700;
}

.main-nav ul {
    display: flex;
    gap: 20px;
}

.main-nav a {
    color: var(--text-color);
    padding: 5px 0;
    transition: color 0.3s;
}

.main-nav a:hover {
    color: var(--primary-color);
}

/* --- ส่วนหลัก (Hero Section) --- */
.hero-section {
    background: url('placeholder-bg.jpg') no-repeat center center/cover; /* แทนที่ด้วยรูปภาพที่เหมาะสม */
    color: #fff;
    text-align: center;
    padding: 100px 20px;
    position: relative;
    z-index: 1;
}

/* เพิ่มเลเยอร์มืดทับรูปภาพเพื่อให้ข้อความอ่านง่าย */
.hero-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: -1;
}

.hero-content h2 {
    font-size: 48px;
    margin-bottom: 10px;
    color: #fff;
}

.hero-content p {
    font-size: 20px;
    margin-bottom: 30px;
}


/* --- ส่วนสินค้า (Products Section) --- */
.products-section {
    text-align: center;
    background: var(--light-bg);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 30px;
}

.product-item {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.product-item img {
    width: 100%;
    height: auto;
    max-height: 180px;
    object-fit: contain;
    margin-bottom: 15px;
    border-radius: 5px;
}

.product-item h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.products-section .row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    background-color: white;
}

.products-section .col-md-3 {
    margin-bottom: 0;
}


/* --- ส่วนข่าวสาร (News Section) --- */
.news-section {
    background: #fff;
}

.news-list {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    margin-top: 30px;
}

.news-item {
    flex: 1;
    border: 1px solid #ddd;
    padding: 20px;
    border-radius: 8px;
    transition: box-shadow 0.3s;
}

.news-item:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.news-item h4 {
    text-align: left;
    color: var(--primary-color);
    margin-bottom: 10px;
}
.news-item p {
    text-align: left;
    margin-bottom: 15px;
    font-size: 14px;
}


/* --- ส่วนท้าย (Footer) --- */
.main-footer {
    background: var(--primary-color);
    color: #fff;
    padding: 40px 0 10px 0;
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.footer-col h4 {
    color: var(--secondary-color);
    text-align: left;
    margin-bottom: 15px;
}

.footer-col p, .footer-col li {
    font-size: 14px;
    margin-bottom: 8px;
}

.footer-col a {
    color: #fff;
    transition: color 0.3s;
}

.footer-col a:hover {
    color: var(--secondary-color);
}

.copyright {
    text-align: center;
    font-size: 12px;
}

/* ========================================= */
/* --- การออกแบบที่รองรับทุกอุปกรณ์ (Responsiveness with Media Queries) --- */
/* ========================================= */

/* สำหรับแท็บเล็ตและหน้าจอขนาดกลาง (น้อยกว่า 992px) */
@media (max-width: 991px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr); /* แสดง 2 คอลัมน์ */
    }
    .news-list {
        flex-direction: column; /* ข่าวสารเรียงเป็นคอลัมน์ */
    }
    .footer-grid {
        flex-direction: column;
    }
    .footer-col h4 {
        margin-top: 20px;
    }
}

/* สำหรับโทรศัพท์มือถือ (น้อยกว่า 576px) */
@media (max-width: 575px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    .main-nav ul {
        flex-direction: column;
        gap: 10px;
        margin-top: 15px;
    }
    .main-nav li {
        width: 100%;
    }
    .main-nav a {
        display: block;
        padding: 5px 0;
    }
    
    .hero-content h2 {
        font-size: 36px;
    }
    .hero-content p {
        font-size: 16px;
    }

    .product-grid {
        grid-template-columns: 1fr; /* แสดง 1 คอลัมน์ */
    }
}

/* (ใช้โค้ด CSS เดิมจากคำตอบที่แล้วทั้งหมด) */

/* --- เพิ่มสไตล์สำหรับ Language Switcher --- */
.language-switcher {
    order: 1; /* จัดให้อยู่ก่อนเมนู (หากเป็น Mobile จะได้อยู่ด้านบนสุด) */
    display: flex;
    gap: 5px;
    margin-right: 20px; /* เว้นระยะห่างจากเมนูเมื่ออยู่บน Desktop */
}

.lang-btn {
    background: none;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s, color 0.2s;
}

.lang-btn.active {
    background: var(--primary-color);
    color: #fff;
}

.lang-btn:hover:not(.active) {
    background: var(--secondary-color);
}

/* ปรับ Media Query สำหรับมือถือ (ให้ Language Switcher อยู่เหนือโลโก้) */
@media (max-width: 575px) {
    .header-content {
        /* ไม่ต้องเปลี่ยนเป็น column เพื่อให้ปุ่มภาษากับโลโก้อยู่ในบรรทัดเดียวกันได้ */
        flex-direction: row;
        flex-wrap: wrap; /* อนุญาตให้หักขึ้นบรรทัดใหม่ */
        justify-content: space-between;
    }
    .logo {
        order: 2;
    }
    .language-switcher {
        order: 3;
        margin-right: 0;
    }
    .main-nav {
        order: 4; /* เมนูอยู่ล่างสุด */
        width: 100%;
    }
    .main-nav ul {
        flex-direction: column;
        gap: 10px;
        margin-top: 15px;
    }

}